package com.forest.datachangetracker.service.audit.impl;

import com.forest.datachangetracker.annotation.DataAudit;
import com.forest.datachangetracker.context.AuditContext;
import com.forest.datachangetracker.service.audit.AuditStrategy;

/**
 * 默认审计策略
 */
public class DefaultAuditStrategy implements AuditStrategy {

    @Override
    public boolean supports(DataAudit dataAudit) {
        return true;
    }

    @Override
    public void execute(AuditContext context, Object result, DataAudit dataAudit, Object oldEntity) {
        // 基础实现
        context.getAuditLogService().recordAuditLog(context, null, null, null, true, null);
    }
}
